package io.itit.ecp.admin.common.enums;

import io.itit.grass.common.enums.IBaseEnum;

import java.io.Serializable;
import java.util.Arrays;
import java.util.List;

/**
 * <p>
 *
 * @Author：Roy
 * @Description：计量设备管理
 * @Date：Create by 2023-11-30 18:51:39
 */
public interface IMeterDeviceEnums {

	/* 设备类型(1:物联网设备,2:非物联网设备) */
	enum DeviceType implements IBaseEnum {
		deviceType1("1", "物联网设备"),
		deviceType2("2", "非物联网设备");

		public final String deviceType;
		public final String desc;

		DeviceType(String deviceType, String desc) {
			this.deviceType = deviceType;
			this.desc = desc;
		}

		@Override
		public Serializable getValue() {
			return deviceType;
		}

		@Override
		public String getDesc() {
			return desc;
		}
	}

	/* 当前状态(1:在线,2:离线) */
	enum DeviceStatus implements IBaseEnum {
		deviceStatus1("1", "在线"),
		deviceStatus2("2", "离线");

		public final String deviceStatus;
		public final String desc;

		DeviceStatus(String deviceStatus, String desc) {
			this.deviceStatus = deviceStatus;
			this.desc = desc;
		}

		@Override
		public Serializable getValue() {
			return deviceStatus;
		}

		@Override
		public String getDesc() {
			return desc;
		}
	}

	/* 计量类型(1:电表,2:水表,3:冷表) */
	enum MeterType implements IBaseEnum {
		meterType1("1", "电表"),
		meterType2("2", "水表"),
		meterType3("3", "冷表");

		public final String meterType;
		public final String desc;

		MeterType(String meterType, String desc) {
			this.meterType = meterType;
			this.desc = desc;
		}

		@Override
		public Serializable getValue() {
			return meterType;
		}

		@Override
		public String getDesc() {
			return desc;
		}

		/**
		 * 根据值查找MeterType枚举实例.
		 *
		 * @param value 枚举值
		 * @return MeterType 枚举实例，如果找不到则返回null
		 */
		public static MeterType findMeterTypeByValue(String value) {
			for (MeterType meterType : MeterType.values()) {
				if (value.equals(meterType.getValue())) {
					return meterType;
				}
			}
			return null;
		}
	}

	/* 读表类型(11:光伏电表,12:储能电表,13:用电电表,21:用水水表,22:消防水表,31:用冷冷表) */
	enum ReadMeterType implements IBaseEnum {
		readMeterType11("11", "光伏电表"),
		readMeterType12("12", "储能电表"),
		readMeterType13("13", "用电电表"),
		readMeterType21("21", "用水水表"),
		readMeterType22("22", "消防水表"),
		readMeterType31("31", "用冷冷表"),
		readMeterType41("14", "充电桩电表");

		public final String readMeterType;
		public final String desc;

		ReadMeterType(String readMeterType, String desc) {
			this.readMeterType = readMeterType;
			this.desc = desc;
		}

		/**
		 * 获取零碳读表类型的数组
		 */
		public static List<String> getZeroCarbonList(){
			return Arrays.asList(readMeterType11.readMeterType, readMeterType12.readMeterType);
		}

		@Override
		public Serializable getValue() {
			return readMeterType;
		}

		@Override
		public String getDesc() {
			return desc;
		}
	}

	/* 读表标识(1:总表,2:分表) */
	enum ReadMeterTag implements IBaseEnum {
		readMeterTag1("1", "总表"),
		readMeterTag2("2", "分表");

		public final String readMeterTag;
		public final String desc;

		ReadMeterTag(String readMeterTag, String desc) {
			this.readMeterTag = readMeterTag;
			this.desc = desc;
		}

		@Override
		public Serializable getValue() {
			return readMeterTag;
		}

		@Override
		public String getDesc() {
			return desc;
		}
	}

	/* 用途(131:空调,132:电梯,133:充电桩,134:照明,221:消防,211:生活用水) */
//	enum Purpose implements IBaseEnum {
//		purpose131("131", "空调"),
//		purpose132("132", "电梯"),
//		purpose133("133", "充电桩"),
//		purpose134("134", "照明"),
//		purpose221("221", "消防"),
//		purpose211("211", "生活用水");
//
//		public final String purpose;
//		public final String desc;
//
//		Purpose(String purpose, String desc) {
//			this.purpose = purpose;
//			this.desc = desc;
//		}
//
//		@Override
//		public Serializable getValue() {
//			return purpose;
//		}
//
//		@Override
//		public String getDesc() {
//			return desc;
//		}
//	}

	/* 启用状态(1:启用,2:禁用) */
	enum Status implements IBaseEnum {
		status1("1", "启用"),
		status2("2", "禁用");

		public final String status;
		public final String desc;

		Status(String status, String desc) {
			this.status = status;
			this.desc = desc;
		}

		@Override
		public Serializable getValue() {
			return status;
		}

		@Override
		public String getDesc() {
			return desc;
		}
	}

	/* 删除标识(1:未删除,2:已删除) */
	enum DelFlag implements IBaseEnum {
		delFlag1("1", "未删除"),
		delFlag2("2", "已删除");

		public final String delFlag;
		public final String desc;

		DelFlag(String delFlag, String desc) {
			this.delFlag = delFlag;
			this.desc = desc;
		}

		@Override
		public Serializable getValue() {
			return delFlag;
		}

		@Override
		public String getDesc() {
			return desc;
		}
	}

}
